﻿using System;
using OneMG.Phoenix.Entity;
using OneMG.Phoenix.Respository;
using IBatisNet.DataMapper;
using OneMG.Phoenix.Kernel.IBatisUtil;
using System.Collections.Generic;

namespace OneMG.Phoenix.IBatisRepository
{
    public class RightsTypeRepository : BaseIBatisDao,IRightsType
    {
        public RightsTypeRepository()
            : base("yihaoke_newMap.Config")
        {

        }
        public System.Int32 AddRightsType(ERightsType entity)
        {
			string stmtId = "RightsTypeMap.InsertRightsType";
			 Object obj = base.SqlMapper.Insert(stmtId, entity);
			 return (System.Int32)obj;
        }
        
		public  ERightsType GetByTypeID (System.Int32 typeID)
        {
			string stmtId = "RightsTypeMap.SelectByTypeID";
			return base.SqlMapper.QueryForObject<ERightsType>(stmtId, typeID);
        }
        
        public  void DeleteByTypeID (System.Int32 typeID)
        {
			string stmtId = "RightsTypeMap.DeleteByTypeID";
			base.SqlMapper.Update(stmtId, typeID);
        }
        
        public  void UpdateByTypeID (ERightsType entity)
        {
			string stmtId = "RightsTypeMap.UpdateByTypeID";
			base.SqlMapper.Update(stmtId, entity);
        }

        public IList<ERightsType> GetAll()
        {
            string stmtId = "RightsTypeMap.SelectAll";
            return base.SqlMapper.QueryForList<ERightsType>(stmtId, null);

        }


    }
}

